package diva.pap.widget;

import static diva.lib.lang.Lang.info;

import android.appwidget.AppWidgetManager;
import android.appwidget.AppWidgetProvider;
import android.content.Context;
import android.content.Intent;
import diva.android_library.lang.AndroidLang;

public class WidgetProvider extends AppWidgetProvider {

  public WidgetProvider() {
    AndroidLang.initialize();
    info("PAP widget created");
  }

  @Override
  public void onDeleted(Context context, int[] appWidgetIds) {
    info("PAP widget deleted");
    super.onDeleted(context, appWidgetIds);
  }

  @Override
  public void onDisabled(Context context) {
    info("PAP widget disabled");
    super.onDisabled(context);
  }

  @Override
  public void onEnabled(Context context) {
    info("PAP widget enabled");
    super.onEnabled(context);
  }

  @Override
  public void onReceive(Context context, Intent intent) {
    info("PAP widget recieve");
    super.onReceive(context, intent);
  }

  @Override
  public void onUpdate(final Context context, AppWidgetManager widgetManager, final int[] widgetIds) {
    info("PAP widget update");
    context.startService(new Intent(context, WidgetUpdateService.class));
    info("PAP widget update done");
  }
}
